// @ts-ignore
/* eslint-disable */
import { PageData, PageParams } from '@/common/page';
import { request } from '@umijs/max';

export async function getProjectPage(
  data: PageParams,
  options?: { [key: string]: any },
) {
  return request<{
    data: PageData;
    msg?: string;
    code: number
    success?: boolean;
  }>('/engine-service/api/v1/project/page', {
    method: 'post',
    data,
    ...(options || {}),
  });
}

export async function updateProject(data: { [key: string]: any }, options?: { [key: string]: any }) {
  return request<{
    data: Record<string, any>;
    msg?: string;
    code: number
    success?: boolean;
  }>('/engine-service/api/v1/project/update', {
    data,
    method: 'PUT',
    ...(options || {}),
  });
}

export async function addProject(data: { [key: string]: any }, options?: { [key: string]: any }) {
  return request<{
    data: Record<string, any>;
    msg?: string;
    code: number
    success?: boolean;
  }>('/engine-service/api/v1/project/save', {
    data,
    method: 'POST',
    ...(options || {}),
  });
}

export async function batchDelProject(data: { idList: any[] }, options?: { [key: string]: any }) {
  return request<{
    data: Record<string, any>;
    msg?: string;
    code: number
    success?: boolean;
  
  }>('/engine-service/api/v1/project/batch_del', {
    data,
    method: 'DELETE',
    ...(options || {}),
  });
}
